#import "UIImage+YLForceDecode.h"
#import "YLWebImageCodersManager.h"

@implementation UIImage (YLForceDecode)

+ (UIImage *)decodedImageWithImage:(UIImage *)image {
    if (!image) {
        return nil;
    }
    NSData *tempData;
    return [[YLWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{YLWebImageCoderScaleDownLargeImagesKey: @(NO)}];
}

+ (UIImage *)decodedAndScaledDownImageWithImage:(UIImage *)image {
    if (!image) {
        return nil;
    }
    NSData *tempData;
    return [[YLWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{YLWebImageCoderScaleDownLargeImagesKey: @(YES)}];
}

@end
